home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
comm
/
mebbs
/
yahtzee.lha
/
yatz
/
yahtzee.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1994-06-05
|
22KB
|
814 lines
/* Yahtzee Version 1.1, original Starnet code by Cameron Arnott. Improved by
Larry Cloud and Ed Kolar. Converted to MEBBSNET Arexx by Larry Cloud. */
signal on ERROR
parse arg LineNumber
options results
DoorName = "Yahtzee"
author = "Larry Cloud"
if( ~show( 'l', "mebbsarexx.library" ) )then do
if( ~addlib( "mebbsarexx.library", 0, -30, 0 ) )then do
say "Could not open library"
exit 10
end
end
call GetVar DoorName,LineNumber,1
username = result
version = "v1.1" /* This version - Please don't change */
if ~show('L','rexxsupport.library') then do
if addlib('rexxsupport.library',0,-30,0) then nop
else do
exit 10
end
end
bbsname = "Kitt's Korner BBS"
sysopname = 'Keith Kittlesen'
maxplays = 6;plays = 0
file1 = 'doors:yatz/scores' /* high scores file. To reset just delete the file in BUL: */
file2 = "doors:yatz/title" /* path for yatz */
file3 = "doors:yatz/instructions.gr1" /* Path for instructions.gr1 */
file13 = 'Doors:yatz/ErrorLog'/* A copy of the errors so that the sysop can fix or report them to the author */
file5 = 'doors:yatz/lastplayer'
file99 = 'bulletins:bul15.txt' /* A REAL bulletin instead of the scores file. */
rer = 0;rnd=random(1,99,time('s'))
file4 = 'doors:yatz/inuse'
call getvar doorname,linenumber,8
Graphic=result
call getvar doorname,linenumber,9
Width=result
call getvar doorname,linenumber,10
Rows=result
call getvar doorname,linenumber,14
BbsPath=result
call getvar doorname,linenumber,15
DoorsPath=result
call getvar doorname,linenumber,16
TextPath=result
call getvar doorname,linenumber,20
Access=result
call getvar doorname,linenumber,21
Handle=result
sk=0
if ~show('L','rexxsupport.library') then do
if addlib('rexxsupport.library',0,-30,0) then nop
else do
say 'support library not available'
exit 10
end
end
if (graphic = '0') then do
call blank
string= 'Whoops, sorry but you will need COLOR & GRAPHICS to play Yahtzee.'
call output
call SHUTDOWN
end
CLS = 'H'
CLR = ''
CLL = ''
HOM = 'H'
OFF = ''
PENBLA = '
'
PENRED = '
'
PENGRE = '
'
PENYEL = '
'
PENBLU = '
'
PENPUR = '
'
PENCYA = '
'
PENWHI = '
'
PAPBLA = '
'
PAPRED = '
'
PAPGRE = '
'
PAPYEL = '
'
PAPBLU = '
'
PAPPUR = '
'
PAPCYA = '
'
PAPWHI = '
'
yatzstart:
if exists(file4) then do
call open file, (file4), 'R'
WHOON = readln(file)
wholine=readln(file)
call close file
if wholine ~= linenumber then do
string=cls
call output
string=" "papWHi""penRED"The Yahtzee game is currently being played by"off
call output
string=" "papgre||penRED""WHOON""papWHi""penRED" on another line."off
call output
string=" "papWHi""penRED"Try back in a little while..."off
call output
call blank
string='Tap any key to continue....'
call getkey
sk=1;signal byebye
end
end
call open last,(file5),'R';xx=readln(last);xx=upper(xx);call close last
if xx=upper(handle) then do
string=cls"Sorry, you were the last player. Gotta let someone else play before you"
call output
string="can play again."
call output
string="Aren't you tired of playing yet anyway?"
call output
string="Press return"
call getkey
x=upper(hot)
call blank
sk=1;signal byebye
end
call open last,(file5),'W';call writeln last,handle;call close last
call open "HI", (file1),'R'
if ~exists(file1) then do
call close "HI"
call open "HI", (file1),'W'
highscore=01
do i = 1 to 10;highname.i="None yet";highscore.i=0
sent = ''highname.i'|'highscore.i;call writeln "HI", sent;end
call close "HI";end
call open "ER", (file13),'R'
if ~exists(file13) then do
call open "ER", (file13),'W'
sent = 'Yahtzee Error Log'
call writeln "ER", sent;sent = '~~~~~~~~~~~~~~~~~~~~~~~';call writeln "ER", sent
end;call close "ER"
TITLE:
string=cls
call msg
call readgra doorname,linenumber,file2
string=HOM||PENCYA" "sysopname||PENGRE" and "PENYEL||bbsname||PENWHI" are proud to present"
call output
call open file, (file1),'R';string=HOM
call output
do i = 1 to 10;inn = readln(file);parse var inn highname.i '|' highscore.i
string=PENRED""PAPWHI""5+i";41H"highname.i""PENPUR""5+i";64H"highscore.i
call msg
end;call close file
string="40H"||PAPBLA""PENWHI
call msg
cmd = 'Z'
do until ((upper(cmd) = 'I') | (upper(cmd) = 'G') | (upper(cmd) = 'Q'))
string=""
call getkey
cmd = hot
if ~exists(file4) then do;call open file, (file4), 'W';call writeln file, handle;call writeln file, linenumber;call close file;end
end
string=upper(cmd)
call output
if (upper(cmd)=='I') then do
call readfile doorname,linenumber,file3
string=PAPBLU""PENYEL" Press any key to continue! "PAPBLA""PENWHI
call output
string=""
call getkey
signal TITLE
end
if (upper(cmd)=='G') then do
plays = plays + 1;if plays > maxplays then signal outofplays
do nu=1 to 6;c.nu=0;end;BONUS=0;CK.3=0;CK.4=0;HOUSE=0;CHANCE = 0;SMALL=0;LARGE=0;YAHT=0
do hy=1 to 12;YBON.hy=0;end;do re=1 to 6;s.re=0;y.re=0;end;sk.3=0;sk.4=0;shouse=0
schance=0;sbonus=0;ssmall=0;slarge=0;syaht=0;do ty= 1 to 12;sybon.ty=0;end;goes=0
call GAME
end
if (upper(cmd)=='Q') then do
call blank
call SHUTDOWN
end
signal getout
GAME:
call carrier
string=cLS||"H"||PENWHI""PAPBLU" YAHTZEE "version" (c) 1993 by Cameron Arnott Maxplays = "maxplays"
"
call msg
string="You have "maxplays-plays+1" plays left out of a possible "maxplays" turns. Please press any key... "
call msg
string=""
call getkey
string=cls||PAPWHI""PENGRE" ONES "PENBLU"| | "PENPUR"Sum of ones "PENGRE" YAHTZEE "PENBLU"| |"PENGRE" 50 "PENPUR"eg:6 6 6 6 6 "
call output
string=PENGRE" TWOS "PENBLU"| | "PENPUR"Sum of twos "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 2nd YAHTZEE "
call output
string=PENGRE" THREES "PENBLU"| | "PENPUR"Sum of threes "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 3rd YAHTZEE "
call output
string=PENGRE" FOURS "PENBLU"| | "PENPUR"Sum of fours "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 4th YAHTZEE "
call output
string=PENGRE" FIVES "PENBLU"| | "PENPUR"Sum of fives "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 5th YAHTZEE "
call output
string=PENGRE" SIXES "PENBLU"| | "PENPUR"Sum of sixes "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 6th YAHTZEE "
call output
string=" "PENBLU">----< "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 7th YAHTZEE "
call output
string=PENGRE" SUB 1 "PENBLU"| | "PENPUR"Total of above "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 8th YAHTZEE "
call output
string=PENGRE" BONUS "PENBLU"| |"PENGRE" 35 "PENPUR"Bonus SUB 1 > 62 "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 9th YAHTZEE "
call output
string=PENGRE" "PENBLU">----< "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 10th YAHTZEE "
call output
string=PENGRE" SUB 2 "PENBLU"| | "PENPUR"SUB 1 + BONUS "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 11th YAHTZEE "
call output
string=PENGRE" "PENBLU">====< "PENGRE" Y/BONUS "PENBLU"| |"PENGRE" 100 "PENPUR"Bonus for 12th YAHTZEE "
call output
string=PENGRE" 3 KIND "PENBLU"| | "PENPUR"Sum of dice "PENBLU">----< "
call output
string=PENGRE" 4 KIND "PENBLU"| | "PENPUR"Sum of dice "PENGRE" SUB 3 "PENBLU"| | "PENPUR"Sub total since SUB 2 "
call output
string=PENGRE" F/HOUSE "PENBLU"| |"PENGRE" 25 "PENPUR"eg:6 6 6 5 5 "PENGRE" SUB 2 "PENBLU"| | "PENPUR"Brought accross "
call output
string=PENGRE" SML STR "PENBLU"| |"PENGRE" 30 "PENPUR"eg:1 2 3 4 6 "PENBLU">====< "
call output
string=PENGRE" LRG STR "PENBLU"| |"PENGRE" 40 "PENPUR"eg:1 2 3 4 5 "PENGRE"GRAND TOTAL "PENBLU"< > "PENPUR"Total Score "
call output
string=PENGRE" CHANCE "PENBLU"| | "PENPUR"Sum of dice "PENBLU">====< "
call output
game2:
string="3HD"PENRED||PAPWHI" DIE 1 DIE 2 DIE 3 DIE 4 DIE 5 Total value of dice "PAPBLA
call output
string=PAPWHI""PENBLA
call msg
sub1=0
do gu=1 to 6;ug=gu
if c.gu=1 & s.gu > 9 then do
string=""||ug||";13H"s.gu
call output
end
if c.gu=1 & s.gu < 10 then do
string=""||ug||";14H"s.gu
call output
end
sub1 = sub1+s.gu
end
if sub1 > 99 then do
string="2H"sub1
call output
end
if sub1 > 9 & sub1 < 100 then do
string="3H"sub1
call output
end
if sub1 < 10 then do
string="4H"sub1
call output
end
if sub1>62 then sbonus=35;BONUS=1
if BONUS=1 & sbonus >9 then do
string="3H"sbonus
call output
end
if BONUS=1 & sbonus <10 then do
string="4H"sbonus
call output
end
sub2=sub1+sbonus
if sub2 > 99 then do
string="12H"sub2
call output
end
if sub2 > 9 & sub2 <100 then do
string="13H"sub2
call output
end
if sub2 < 10 then do
string="14H"sub2
call output
end
if CK.3=1 then do
string="13H"sk.3
call output
end
if Ck.4=1 then do
string="13H"sk.4
call output
end
if HOUSE=1 then do
string="13H"shouse
call output
end
if SMALL=1 then do
string="13H"ssmall
call output
end
if LARGE=1 then do
string="13H"slarge
call output
end
if CHANCE=1 & schance > 9 then do
string="13H"schance
call output
end
if CHANCE=1 & schance < 10 then do
string="14H"schance
call output
end
if YAHT=1 then do
string="9H"syaht
call output
end
do fy=2 to 12
if YBON.fy=2 then do
string=""||fy+1||";48H"sybon.fy
call output
end
end
sub3 = sk.3 + sk.4 + shouse + ssmall + slarge + schance + syaht
do fq=2 to 12
sub3=sub3+sybon.fq
end
if sub3 > 999 then do
string="47H"sub3
call output
end
if sub3>99 & sub3<1000 then do
string="48H"sub3
call output
end
if sub3>9 & sub3<100 then do
string="49H"sub3
call output
end
if sub3<10 then do
string="50H"sub3
call output
end
if sub2>99 then do
string="48H"sub2
call output
end
if sub2>9 & sub2<100 then do
string="49H"sub2
call output
end
if sub2<10 then do
string="50H"sub2
call output
end
gtotal=sub2+sub3
if gtotal>999 then do
string="47H"gtotal
call output
end
if gtotal>99 & gtotal<1000 then do
string="48H"gtotal
call output
end
if gtotal>9 & gtotal<100 then do
string="49H"gtotal
call output
end
if gtotal<10 then do
string="50H"gtotal
call output
end
string= "1H"PAPBLA
call output
roll = 0
if rer=1 then do i= 1 to 5;t.i=0;end
else do i= 1 to 5lt.i=1;end
call carrier
if goes = 13 then do
string=cls
call output
string="20H"PENGRE""PAPBLA" Press any key to see if"
call output
string="20H"PENYEL" you have made it onto the"
call output
string="20H"PENPUR" High Scores list...."
call output
string="20H"PENGRE" With a score of... "gtotal
call output
string=""
call getkey
call HIGH
end
call CHOISE
signal getout
THROW_DICE:
do d = 1 to 5
if t.d = 1 then do
throw = ((random(2,14)/2)%1)
if throw = 0 then throw = 1
if throw = 7 then throw = 6
if rer=1 then throw=die.d
die.d=throw
end
if t.d = 0 then do;throw=die.d;end
if d = 1 then do;y_coord = 3;call PLOT_DIE;end
if d = 2 then do;y_coord = 12;call PLOT_DIE;end
if d = 3 then do;y_coord = 21;call PLOT_DIE;end
if d = 4 then do;y_coord = 30;call PLOT_DIE;end
if d = 5 then do;y_coord = 39;call PLOT_DIE;end
end
string="3H"PENRED""PAPWHI" DIE 1 12H DIE 2 21H DIE 3 30H DIE 4 39H DIE 5 "
call output
roll=roll+1;if rer=1 then roll=reroll
t.1=0;t.2=0;t.3=0;t.4=0;t.5=0;tvalue = 0
do a = 1 to 5;tvalue = tvalue + die.a;end
string="72H"PENBLU""tvalue
call output
string="50H"PENGRE""PAPBLA" Dice after "roll" roll "
call output
if roll >2 then do;lop=0;call SCORE;end
if roll <3 then do
string="50H"PENYEL" Press 1-5 [R]edraw "
call output
end
if roll <3 then do
string="49H"PENPUR" [S]core [D]ice [Q]uit "
call output
end
return
PLOT_DIE:
call carrier
string= PENBLU""PAPCYA
call msg
if throw = 1 then do
string=""y_coord"H "
call msg
string=""y_coord"H o "
call msg
string=""y_coord"H "PAPBLA
call msg
end
if throw = 2 then do
string=""y_coord"H o "
call msg
string=""y_coord"H "
call msg
string=""y_coord"H o "PAPBLA
call msg
end
if throw = 3 then do
string=""y_coord"H o "
call msg
string=""y_coord"H o "
call msg
string=""y_coord"H o "PAPBLA
call msg
end
if throw = 4 then do
string=""y_coord"H o o "
call msg
string=""y_coord"H "
call msg
string=""y_coord"H o o "PAPBLA
call msg
end
if throw = 5 then do
string=""y_coord"H o o "
call msg
string=""y_coord"H o "
call msg
string=""y_coord"H o o "PAPBLA
call msg
end
if throw = 6 then do
string=""y_coord"H o o "
call msg
string=""y_coord"H o o "
call msg
string=""y_coord"H o o "PAPBLA
call msg
end
return
CHOISE:
sc=0
if roll = 0 then do
do count=1 to 5;t.count =1;end;call THROW_DICE;end
if roll < 3 then do until ((upper(cmd) = 'S') | (upper(cmd) = 'Q') | (upper(cmd) = 'D') | (upper(cmd) = 'R') | (cmd = 1) | (cmd = 2) | (cmd = 3) | (cmd = 4) | (cmd = 5))
string=""
call getkey
cmd = hot
end
if (upper(cmd)='S') then do;lop=0;call SCORE;end
if (upper(cmd)='D') then do;rer=0;call THROW_DICE;end
if (upper(cmd)='R') then do;rer=1;reroll=roll;signal GAME
end
if (upper(cmd)='Q') then call SHUTDOWN
if (0<cmd & 6>cmd) then call HIGHLIGHT
signal CHOISE
HIGHLIGHT:
z=0
do i=0 to 5
if (i = cmd & z=0 & t.i=0) then do
t.i= 1
string=""3+((cmd-1)*9)"H"PENWHI""PAPRED" DIE "cmd" 1H"PAPBLA""PENWHI
call output
z=1
end
if (i = cmd & z=0 & t.i=1) then do
t.i= 0
string=""3+((cmd-1)*9)"H"PENRED""PAPWHI" DIE "cmd" 1H"PAPBLA""PENWHI
call output
z=1
end
end
return
SCORE:
ch=0
do v = 1 to 5;sort.v=die.v;end;call SORT
string="50H"PENYEL" Place it against- "
call output
if ch=0 & YAHT=0 then do
if die.1=die.2 & die.2=die.3 & die.3=die.4 & die.4=die.5 & YAHT=0 then do
syaht=50;end
else do;syaht=0;end
string="50H"PENGRE" YAHTZEE :- "syaht" Points. "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
if die.1=die.2 & die.2=die.3 & die.3=die.4 & die.4=die.5 & YAHT=0 then do
YAHT=1;ch=1;YBON.1=1;end
else do;YAHT=1;ch=1;YBON.1=1;end
goes=goes+1;call game2;end;end
if die.1=die.2 & die.2=die.3 & die.3=die.4 & die.4=die.5 & YAHT=1 & ch=0 & lop=0 then do
string="50H"PENGRE""PAPBLA" YAHTZEE! :- 100 Points "
call output
string="50H"PENYEL" BONUS! "
call output
string="50H"PENPUR" Press any key to Continue. "
call output
do yb=1 to 12;by = yb+1
if YBON.yb=1 & YBON.by=0 & ch=0 & lop=0 then do
YBON.by=1;sybon.by=100;lop=1;ch=1;end;end
string=""
call getkey
string="50H"PENYEL" Place it against- "
call output
end
ch=0
if LARGE=0 & ch=0 & ((sort.1=1 & sort.2=2 & sort.3=3 & sort.4=4 & sort.5=5)|(sort.1=2 & sort.2=3 & sort.3=4 & sort.4=5 & sort.5=6)) then do
string="47H"PENGRE" Large Straight :- 40 Points. "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
LARGE=1;slarge=40;ch=1;goes=goes+1;call game2;end;end
else do
if LARGE=0 & ch=0 then do
string="47H"PENGRE" Large Straight :- 0 Points. "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
LARGE=1;slarge=0;ch=1;goes=goes+1;call game2;end;end;end
if SMALL=0 & ch=0 & ((sort.2=sort.1+1 & sort.3=sort.2+1 & sort.4=sort.3+1)|(sort.3=sort.2+1 & sort.4=sort.3+1 & sort.5=sort.4+1)|(sort.3=sort.1+1 & sort.4=sort.3+1 & sort.5=sort.4+1)|(sort.2=sort.1+1 & sort.4=sort.2+1 & sort.5=sort.4+1)|(sort.2=sort.1+1 & sort.3=sort.2+1 & sort.5=sort.3+1)) then do
string="47H"PENGRE" Small Straight :- 30 Points. "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
SMALL=1;ssmall=30;ch=1;goes=goes+1;call game2;end;end
else do
if SMALL=0 & ch=0 then do
string="47H"PENGRE" Small Straight :- 0 Points. "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
SMALL=1;ssmall=0;ch=1;goes=goes+1;call game2;end;end;end
num = sort.3;kl.num=0;do op= 1 to 5;if num = sort.op then kl.num=kl.num+1;end
if CK.4=0 & ch=0 & ((sort.1=sort.2 & sort.2=sort.3 & sort.3=sort.4)|(sort.2=sort.3 & sort.3=sort.4 & sort.4=sort.5)) then do
string="47H"PENGRE" 4 of a Kind :- "tvalue" "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
CK.4=1;sk.4=tvalue;ch=1;goes=goes+1;call game2;end;end;else do
if CK.4=0 & ch=0 then do
string="47H"PENGRE" 4 of a Kind :- 0 "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
CK.4=1;sk.4=0;ch=1;goes=goes+1;call game2;end;end;end
if HOUSE=0 & ch=0 & ((sort.1=sort.2 & sort.1=sort.3 & sort.4=sort.5)|(sort.1=sort.2 & sort.3=sort.4 & sort.3=sort.5)) then do
string="47H"PENGRE" Full House :- 25 Points "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
HOUSE=1;shouse=25;ch=1;goes=goes+1;call game2;end;end;else do
if HOUSE=0 & ch=0 then do
string="47H"PENGRE" Full House :- 0 Points "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
HOUSE=1;shouse=0;ch=1;goes=goes+1;call game2;end;end;end
if CK.3=0 & ch=0 & ((sort.1=sort.2 & sort.1=sort.3)|(sort.2=sort.3 & sort.2=sort.4)|(sort.3=sort.4 & sort.3=sort.5)) then do
string="47H"PENGRE" 3 of a Kind :- "tvalue" "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
CK.3=1;sk.3=tvalue;ch=1;goes=goes+1;call game2;end;end;else do
if CK.3=0 & ch=0 then do
string="47H"PENGRE" 3 of a Kind :- 0 "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
CK.3=1;sk.3=0;ch=1;goes=goes+1;call game2;end;end;end
do t= 1 to 6;jl.t=0
do t1= 1 to 5;if sort.t1 = t then do
jl.t= jl.t + t;end;end
if ch=0 & c.t=0 then do
string="47H"PENGRE" Number " t " :- " jl.t " "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if (upper(cmd)=='Y')then do
ch=1;s.t=jl.t;c.t=1;goes=goes+1;call game2;end;end;end
if (ch=0 & CHANCE=0) then do
string="47H"PENGRE" Chance :- "tvalue" "
call output
string="69H"PENRED" {Y/N}"
call output
do until ((upper(cmd) = 'Y') | (upper(cmd) = 'N'))
string=""
call getkey
cmd = hot
end
if(upper(cmd)=="Y") then do
ch=1;CHANCE=1;schance=tvalue;goes=goes+1;call game2;end;end;signal SCORE
SORT:
flag=0
do f=1 to 4;g=f+1;if sort.f > sort.g then do
temp = sort.f;sort.f=sort.g;sort.g=temp;flag=1;end;end;if flag=1 then signal SORT
return
HIGH:
if highscore.10 > gtotal then do
string="Congratulations! For getting on the high scores board, I'm awarding you an"
call output
string="extra 15 minutes online!"
call output
call blank
minutes=15
call addtime
end
highscore.11 = gtotal;highname.11 = Handle
do hg = 1 to 10;do hk = hg + 1 to 11
if highscore.hg < highscore.hk then do
tempscore = highscore.hg;highscore.hg = highscore.hk;highscore.hk = tempscore
tempname = highname.hg;highname.hg = highname.hk;highname.hk = tempname
end;end;end
call open "HI", (file1),'W'
do i = 1 to 10;sent = ''highname.i'|'highscore.i;call writeln "HI", sent;end
call close "HI";signal TITLE
signal shutdown
SHUTDOWN:
if exists(file4) then do
flnm=file4
call deletefile
end
signal byebye
outofplays:
string=cls||pencya"Sorry, "pengre||handle||pencya", you are out of plays. Try again later."
call output
call blank
string="Note that someone else must play before you can play again."
call output
call blank
string=pengre"Press any key..."
call getkey
signal shutdown
BYEBYE:
if sk=0 then call makebul
signal getout
makebul:
spzz=" "
call open "bulletin", (file99),'W'
call writeln "bulletin", " Yahtzee Top Ten Scores"
call writeln "bulletin", " _______ ___ ___ ______"
call writeln "bulletin"," "
call writeln "bulletin"," "
do i = 1 to 9;x1=length(highname.i);spz=30-x1;sent = i||". "||highname.i ||left(spzz,spz)||highscore.i
call writeln "bulletin", sent;end;x1=length(highname.10);spz=30-x1
sent = "10. "||highname.i ||left(spzz,spz)||highscore.i;call writeln "bulletin", sent
call writeln "bulletin"," ";call writeln "bulletin","Lets see if you can get on the high scores list,"
call writeln "bulletin","~v1. Go to the DOORS menu now!";call writeln "bulletin","~vc"
call close "bulletin";return
GETKEY:
call hotkey doorname,linenumber,string
hot=result
call carrier
return
OUTPUT:
call message doorname,linenumber,string,1
return
MSG:
call message doorname,linenumber,string,0
return
BLANK:
string = " "
call output
return
GETOUT:
string = "You've been using "||doorname||" by "||author||"."
call output
call blank
string = "Thank you, "||username||", please press [RETURN] or [ENTER]."
call getkey
call blank
call Exit_Door DoorName,LineNumber
exit 0
ERROR:
call Exit_Door DoorName,LineNumber
exit 0
deletefile:
address command "delete "flnm
return
AddTime:
call AddUserTime doorname,linenumber,minutes
return
Carrier:
call CDetect doorname,linenumber
cd=upper(result)
if cd="NO CARRIER!" then signal error
return